//获取列表页的json数据.
//字符串模板写列表页.
$.ajax({
	type:"get",
	url:"../Json/list(liebiao).json",
	async:true,
	success:function(date){
		
		var html="";
		//遍历json
		date.forEach(function(value,index){
			//console.log(value.miaosha);
			html +=`
				<li>
				<div id="list_img_box" class="list_img_box">
					<a href="xiangqing.html"><img src=${value.img} alt="" /></a>
					<p id="list_img_box_float" class="list_img_box_float">
						<span id="list_img_box_float_left" class="list_img_box_float_left">
							||| 胖胖胖胖胖
						</span>
						<span id="list_img_box_float_right" class="list_img_box_float_right">
							||| 蛋蛋蛋蛋蛋
						</span>
					</p>
				</div>
				<div id="list_price_box" class="list_price_box">
					<span id="list_price_price" class="list_price_price">
						${value.price}
					</span>
					<span id="list_price_background" class="list_price_background" style="background:url(${value.miaosha}) no-repeat -10px -190px">
						
					</span>
				</div>
				<div id="list_xiangjie" class="list_xiangjie">
					<p id="list_xiangjie_zi" class="list_xiangjie_zi">
						${value.zi}
					</p>
					<p id="list_xiangjie_img" class="list_xiangjie_img">
						<img src="../image/list_img/hehe.png" alt="" />
					</p>
				</div>
			</li>
			`
		})
		$("#list").append(html);
		//添加滑过事件.
		$(".list_img_box").hover(function(){
			$(this).children(".list_img_box_float").css({display:"block"})
		},function(){
			$(this).children(".list_img_box_float").css({display:"none"})
		})
		//console.log($(".list_img_box"));
	}
})

//列表页右边
$.ajax({
	type:"get",
	url:"../Json/listRight.json",
	async:true,
	success:function(date){
		//console.log(date);
		var html = "";
		date.forEach(function(value){
			html +=`
				<li>
					<div class="yzs666">
						<a href="#">
							<img src="${value.img}" alt="" />
						</a>
					</div>
					<p class="yzs888">
						<a href="#">
							${value.miaoshu}
						</a>
					</p>
					<span id="jiage">
							${value.jiage}
					</span>
				</li>
			`
		})
		//将模板放进去.
		$("#list_right").append(html);
	}
})

